
function validator(rule, value, callback) {
    if (!icu.util.jude(value, 'int')) {
        callback()
    } else {
        callback(new Error('只能为正整数'));
    }
}
function ywhszmbmValidator(rule, value, callback) {
    if (/^[A-Z]{1,2}$/.test(value)) {
        callback()
    } else {
        callback(new Error('请输入一到两位大写字母'));
    }
}
let config = {
    isShow: true,
    name: 'departmentAddUpdata',
    labelWidth: 160,
    form: [
        { type: 'input', dataType: 'text', key: 'name', label: '名称', icon: '', disabled: false, placeholder: '请输入名称', showwordlimit: true, maxlength: 25, default: '' },
        { type: 'treeSelect', key: 'pid', label: '上级部门', data: [], disabled: false, },
        { type: 'cascader', key: 'region', label: '所属行政区', disabled: false, placeholder: '请选择租户编码', clearable: true, filterable: true, changeOnSelect: true, option: [], default: [] },
        { type: 'input', dataType: 'text', key: 'sort', label: '排序', icon: '', disabled: false, placeholder: '排序', showwordlimit: true, maxlength: 3, default: 0 },
        { type: 'input', dataType: 'text', key: 'xzqbs', label: '业务号首字母编码', icon: '', disabled: false, placeholder: '请输入一到两位大写字母', showwordlimit: true, maxlength: 2, default: '' },
    ],
    rules: {
        region: [{ type: 'array', required: true, message: '请选择', trigger: 'change' }],
        name: [{ required: true, message: '请输入名称', trigger: 'change' }],
        pid: [{ required: true, message: '请输入上级部门', trigger: 'blur' }],
        sort: [{ validator: validator, trigger: 'change' }],
        xzqbs: [{ required: true, validator: ywhszmbmValidator, trigger: 'change' }],
    },
    grid: { xl: 24, lg: 24, md: 24, sm: 24, xs: 24 },
    event: {} // 动态绑定事件
}
export { config }